#include <iostream>
#include <unordered_set>
using namespace std;

// Definition for singly-linked list.
struct ListNode {
    int val;
    ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};

class Solution {
public:
    int kthToLast(ListNode* head, int k) {
        ListNode* former = head;
        ListNode* latter = head;
        for(int i = 0;i < k ;++i)
        {
            latter = latter->next;
        }
        while(latter != nullptr)
        {
            latter = latter->next;
            former = former->next;
        }
        return former->val;
    }
};

int main()
{
    return 0;
}